package com.dg11185.nearshop.net.request;

import com.dg11185.libs.network.http.client.HttpRequest;
import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.app.Constants;
import com.dg11185.nearshop.net.response.ActiveResponse;

public class ActiveRequest extends HttpRequest<ActiveResponse> {
	public final static String msgCode = "msgCode";

	public ActiveRequest(String cardFaceNo, String cardPwd,String mobilePhone) {		
		super(Constants.ADDRESS, Constants.active);
        addParam("cardFaceNo", cardFaceNo);
        addParam("cardPwd", cardPwd);
        addParam("mobilePhone", mobilePhone);
		addParam("chshToken", Constants.TOKEN);
	}

	public ActiveRequest add(String key, String value) {
		addParam(key, value);
		return this;
	}

	public ActiveRequest encryption() {
		addParam("chshSign", MD5Utils.getMD5Str(getParams(), Constants.MD5_key));
		return this;
	}

	@Override
	protected ActiveResponse parseJson(String response) throws Exception {
		ActiveResponse res = new ActiveResponse();
		res.parseJson(response);
		return res;
	}

}
